<?php
	include 'header.php';
	//print_r($_GET);
	if(!empty($_GET['u']) && !empty($_GET['e']) && !empty($_GET['p']) && !empty($_GET['t'])){
		$stmt = $pdo->prepare('select uid,uname,email,help,helpok from kp_usr where md5(uname)=? and md5(email)=? and md5(upwd)=?');
		$stmt->execute(array($_GET['u'],$_GET['e'],$_GET['p']));
		$rows = $stmt->rowCount();
		$usrArr = $stmt->fetch(PDO::FETCH_ASSOC);
		if($rows < 1){
			die('<h1>非法操作!</h1>');
		}else{
			$_SESSION['userhelp'] = $usrArr;
			$_SESSION['userhelp']['ok'] = 2;
		}
		//print_r($usrArr);
	}
	if(!isset($_SESSION['userhelp']['ok']) || $_SESSION['userhelp']['ok'] != 2){
		die('<h1>非法操作!</h1>');
	}
	
?>

<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<link rel="stylesheet" type="text/css" href="css/password.css"/>
	<script src="js/jquery-3.1.1.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/password.js" type="text/javascript" charset="utf-8"></script>
	<title>密码找回</title>
</head>
<body>
	<div id="password">
		<div id="three">
			<ul class="title">
				<li>1. 填写帐号</li>
				<li>2. 确认验证信息</li>
				<li>3. 修改密码</li>
			</ul>
			<ul class="content">
				<li class="left">密码:</li>
				<li><input type="password" name="pwd" id="pwd" value="" /></li>
				<li class="left">确认密码:</li>
				<li><input type="password" name="pwd1" id="pwd1" value="" /></li>
				<!--<li class="left">验证码:</li>
				<li><input type="text" name="ucode" id="ucode" value="" size="2" /><img style="margin-left: 5px;"  title="点击刷新" id="codeimg" src="./gdcode.php" align="absbottom" onclick="this.src='gdcode.php?'+Math.random();"></img></li>
				-->
				<li class="left"></li>
				<li class="go">
					<input type="button" name="setpwd" id="setpwd" value="修改密码" />
					<img id="ajaxload01" align="absbottom"  src="images/ajax-0.gif" width="32px" height="32px"/>
				</li>
			</ul>
			<h2 id="setover" style="text-align: center;">aa</h2>
			
			
			<!--<h4 style="margin-top: 30px; text-align: center;">密码更改成功!,请<a href="login.php">登陆</a>!</h4>-->
		</div>
	</div>
	<?php include_once 'bottom.php'; ?>
</body>
</html>